﻿using Synthesize.Common.Domain.Event;
using System.Threading.Tasks;

namespace Synthesize.Common.ServiceInterface.UseCase
{
    /// <summary>
    /// 服务安全相关逻辑
    /// </summary>
    public interface ISafeService
    {
 
        /// <summary>
        /// 获取对应IP+时间戳的记录
        /// </summary>
        /// <param name="requestIp"></param>
        /// <param name="timestamp"></param>
        /// <returns></returns>
        Task<bool> JudgeReplayAttack(string requestIp, string timestamp);

        /// <summary>
        /// 插入接口访问监控日志
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<bool> SaveApiMonitorLog(SafeApiMonitorLogEvent input);

        /// <summary>
        /// 删除过期接口访问记录信息
        /// </summary>
        Task RemoveExpiredApiMonitorLog();

        /// <summary>
        /// 插入接口访问次数
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<bool> IncrementApiMonitorNumber(SafeApiMonitorLogEvent input);

    }
}
